package caiziyou.com.designpattern.factory.method.order;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import caiziyou.com.designpattern.factory.method.pizza.Pizza;


public abstract class OrderPizza {
	Pizza pizza = null;
	public abstract Pizza createPizza(String orderType);
	public OrderPizza() {
		do {
			pizza = createPizza(getType());
		} while (true);
	}

	public String getType() {

		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
		try {
			System.out.println("input pizza type:");
			return bufferedReader.readLine();
		} catch (IOException e) {

			return "";
		}
	}
}
